home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 8206 / 8206.xpi / content / webmail / yahooclassic2.js < prev   
Text File  |  2010-02-02  |  2KB  |  91 lines

  1. //WISELOG("[yahooclassic2.js] >>>>>");
  2.  
  3. eventWin.addEventListener("load",function(event){yahoosig.pageload(event)},true);
  4. eventWin.addEventListener("unload",function(event){yahoosig.uninitView(event)},true);
  5.  
  6. var yahoosig =
  7. {
  8.     current: null,
  9.     pageload: function (event)
  10.     {
  11.         //    WISELOG("[yahooclassic2.js::pageload] >>>>>");
  12.         try
  13.         {
  14.             wisestampsig.refreshCallback = yahoosig.refreshSignature;
  15.             setTimeout(function ()
  16.             {
  17.                 yahoosig.setupCompose();
  18.             },
  19.             0);
  20.         } catch(e)
  21.         {
  22.             //      WISELOG(e);
  23.         }
  24.     },
  25.     uninitView: function ()
  26.     {
  27.         if (this.current && this["uninit" + this.current])
  28.         {
  29.             this["uninit" + this.current]();
  30.         }
  31.     },
  32.     setupCompose: function ()
  33.     {
  34.         //    WISELOG("[yahooclassic2.js::setupCompose] >>>>>");
  35.         yahoosig.addWisestampIcon();
  36.         var iframes = evaluateXPath(document, "//iframe[@id='compose_editorArea']");
  37.         if (iframes && iframes.length > 0)
  38.         {
  39.             for (var i = 0; i < iframes.length; i++)
  40.             yahoosig.insertSignature(iframes[i]);
  41.         }
  42.     },
  43.     addWisestampIcon: function ()
  44.     {
  45.         //    WISELOG("[yahooclassic2.js::addWisestampIcon] >>>>>");
  46.         if (wisestampsig.showButton)
  47.         {
  48.             //      WISELOG("[yahooclassic2.js::setupCompose] document.location: " + document.location);
  49.             var cont = document.getElementById("compose_palette");
  50.             var a = document.createElement("a");
  51.             a.setAttribute("class", "DhtmlButtonText");
  52.             a.setAttribute("style", "position: absolute; top: 4px; display: block; width: 26px; height: 20px; background-image: url(" + wisestampsig.icon + "); background-position: 5px 3px; background-repeat: no-repeat; left: 510px;");
  53.             a.setAttribute("title", "#href=WiseStamp")
  54.             cont.appendChild(a);
  55.             wisestampsig.initOptionsIcon(a);
  56.         }
  57.     },
  58.     uninitCompose: function ()
  59.     {
  60.  
  61.     },
  62.     iframeTries: 1,
  63.     refreshSignature: function ()
  64.     {
  65.         wisestampsig.insertSignature(yahoosig.iframe, false);
  66.     },
  67.     insertSignature: function (iframe)
  68.     {
  69.         //    WISELOG("[yahooclassic2.js::insertSignature] >>>>>");
  70.         this.iframe = iframe;
  71.         this.iframe.addEventListener('load', yahoosig.iframeLoad, false);
  72.         this.iframeLoad(false);
  73.     },
  74.     iframeLoad: function (event)
  75.     {
  76.         //    WISELOG("[yahooclassic2.js::iframeLoad] >>>>>");
  77.         setTimeout(function ()
  78.         {
  79.             wisestampsig.insertSignature(yahoosig.iframe, true);
  80.             if (event)
  81.             {
  82.                 try
  83.                 {
  84.                     yahoosig.iframe.removeEventListener('load', yahoosig.iframeLoad, false);
  85.                 } catch(e)
  86.                 {}
  87.             }
  88.         },
  89.         !event ? 500 : 100);
  90.     }
  91. };